package com.example.consumer.controller;

import com.example.commons.utils.ExceptionEnum;
import com.example.commons.utils.JinZhiException;
//import com.example.consumer.servier.TestServierOpenfeign;
import com.example.consumer.servier.TestServierOpenfeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController
@RequestMapping("/consumer")
@Slf4j
public class JzConsumerTest {

    @Autowired
    private TestServierOpenfeign testServierOpenfeign;
    @Value("${server.port}")
    private String prot;


    @GetMapping("/test")
    public String test(){
        log.info("这是日志");
      //  throw new JinZhiException(ExceptionEnum.INVALID_PARAM_ERROR.getStatus(),ExceptionEnum.INVALID_PARAM_ERROR.getMessage());
        //return "hello consumer";
        return prot;
    }

    @GetMapping ("/testClient")
    public String testClient( String day){
        System.out.println("dev");
        System.out.println("分支保护测试");
        System.out.println("分支保护测试2022：1738");
        return testServierOpenfeign.countRegister("nu");
        //  return "";
    }

}
